#ifndef __DRIVER_ADC_H__
#define __DRIVER_ADC_H__

#include "Driver_GPIO.h"
#include "fm33lg0xx_fl.h"

typedef enum
{
    ADC_GPIO_INDEX_KEY = 0U,
    ADC_GPIO_INDEX_MAX
} ADCGPIOIndex_e;

typedef enum
{
    ADC_CHANNEL_KEY = FL_ADC_EXTERNAL_CH15,
} ADCChannel_e;

/**
 * @brief 初始化ADC
 *
 */
void Driver_ADC_Init(void);

/**
 * @brief 获取电压值, 使用了一阶低通滤波
 *
 * @param channel 通道号
 * @return uint32_t 真实电压值mV
 */
uint32_t Driver_ADC_GetVoltage(uint32_t channel);

/**
 * @brief 启动ADC采样
 *
 * @param channel 通道号
 */
void Driver_ADC_StartSample(uint32_t channel);

#endif
